# 将 bin/config.yaml 同步为内置默认配置（若存在）
if [ -f bin/config.yaml ]; then
  cp bin/config.yaml cmd/server/config.default.yaml
fi

# 编译三个平台的二进制文件
GOOS=linux GOARCH=amd64 go build -ldflags "-w -s" -trimpath -o bin/linux/stream-server ./cmd/server
GOOS=windows GOARCH=amd64 go build -ldflags "-w -s" -trimpath -o bin/windows/stream-server.exe ./cmd/server
GOOS=darwin GOARCH=arm64 go build -ldflags "-w -s" -trimpath -o bin/darwin/stream-server ./cmd/server
